﻿using System;
using System.Collections.Generic;
using System.Text;
using Lant.Net.Model;

namespace Lant.Net.Game
{
	public abstract class Puke : System.Windows.Forms.UserControl, Lant.Net.IGame.IGame
	{
		#region 实现接口

		public abstract string GameName
		{
			get;
		}
		public abstract string GameRule
		{
			get;
		}

		public abstract bool Start();

		public virtual object Control()
		{
			return this;
		}
		#endregion

		protected virtual List<PukeCard> GetSelected(List<PukeCard> list)
		{
			List<PukeCard> temp = new List<PukeCard>();
			foreach (PukeCard p in list)
			{
				if (p.Selected)
					if (temp.Count > 0)
						if (temp[0].Number == p.Number)
							temp.Add(p);
						else
						{
							temp.Clear();
							break;
						}
					else
						temp.Add(p);
			}
			return temp;
		}

		private void InitializeComponent()
		{
			this.SuspendLayout();
			// 
			// Puke
			// 
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
			this.BackColor = System.Drawing.SystemColors.Info;
			this.Name = "Puke";
			this.ResumeLayout(false);

		}
	}
}
